package com.huxin.servelt.admin;


import com.alibaba.fastjson.JSON;
import com.huxin.pojo.BookStorage;
import com.huxin.pojo.BooksInfo;
import com.huxin.service.Userservice;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Date;

/**
 * 根据aid删除用户数据
 */
@WebServlet("/admin/deleteUser")
public class AdminDeleteUserServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String aid = req.getParameter("aid");
        Userservice userservice = new Userservice();
        int i=userservice.deleteUser(aid);
        if (i==1){
            resp.getWriter().write("1");
        }
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }
}
